home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / fweb / fweb-1.40 / boot / unix / sun / gcc / custom.h < prev    next >
C/C++ Source or Header  |  1993-10-29  |  14KB  |  414 lines

  1. #if(0)
  2. "WARNING: "CC" is already undefined.  (Input l. 12 in ./custom.web.) "
  3. #endif
  4.  
  5. /* --- BOOTSTRAPPING --- */
  6.  
  7. /* To bootstrap yourself onto a new system, you should modify this file \
  8. appropriately.  In most cases, you set a flag by saying ``\.{\#define \
  9. FLAG}''---i.e., you make a null definition.  Don't set these flags to~0 \
  10. or~1.  However, in a few cases the macros are not flags and must be given \
  11. the appropriate definition. */
  12.  
  13. /* --- MACHINE COMPILER FLAG --- */
  14.  
  15. /*  This must be in lower case.   Presently these are drawn \
  16. from the list \.{ansi}, \.{apollo}, \.{bsd}, \.{dsu}, \.{ibmpc}, \.{mac}, \
  17. \.{misc}, \.{mvs}, \.{sgi}, \.{sun}, \.{vax}.  These flags may be used in \
  18. \.{\#define} statements within the source code to tailor things to a \
  19. particular compiler or operating system. */
  20. #ifndef sun
  21. #define sun
  22. #endif /* |sun| */
  23.  
  24.  
  25. /* --- FWEB SYSTEM NAME --- */
  26.  
  27. /* This is a string such  as ``\.{IBM-PC/DOS}'' or ``\.{VAX/VMS}''. It is \
  28. printed when FWEB starts up.--- */
  29. #define THE_SYSTEM  "SunOS/UNIX"
  30.  
  31. /* --- An optional local banner, printed after the system name above. --- */
  32.  
  33. #define LOCAL_BANNER ""
  34.  
  35.  
  36. /* Does your compiler understand the ANSI preprocessor command \.{\#error}? \
  37. If it does, define |HAVE_ERROR|.  (I haven't figured out a general \
  38. \.{autoconf} test yet; it seems to be impossible in principle.) */
  39.  
  40. #define HAVE_ERROR 1
  41.  
  42.  
  43. /* Do we bother with translations to the internal |ASCII| representation? \
  44. If so, define |TRANSLATE_ASCII|.  Don't bother on |ASCII| machines. */
  45.  
  46. #define TRANSLATE_ASCII 0
  47.  
  48. /* For \It{debugging} of target machines whose character set differs from the \
  49. one on which you're working, define |DEBUG_XCHR|.  \It{Usually, this flag \
  50. should not be defined.}  When it is defined, the |TRANSLATE_ASCII| flag is \
  51. automatically turned on, and the value of the style-file field \
  52. \.{xchr} is relevant. \It{Don't use this flag unless you're a system \
  53. developer!!!} */
  54.  
  55. #define DEBUG_XCHR 0
  56.  
  57.  
  58. /* Does the operating system have a Unix-like path?  That is, does it have \
  59. the form \.{/u/krommes} rather than the VMS form \.{ux3:[krommes]}? \
  60. If so, define |UNIX_PATH|. */
  61.  
  62. #define UNIX_PATH 1
  63.  
  64.  
  65. /* If the |getenv| call to obtain an environment variable is supported \
  66. (it usually is) define |HAVE_GETENV|. */
  67. #define HAVE_GETENV 1
  68.  
  69.  
  70. /* --- FILE NAMES and EXTENSIONS --- */
  71.  
  72. /* Name of the null file.  IBMPC:  \.{"nul"}; Unix: \.{"/dev/null"}; VAX: \
  73. \.{"nl:"}. */
  74. #define NULL_FILE_NAME "/dev/null" /* For Unix systems. */
  75.  
  76. /* Name of \FWEB's initialization file.  Please see below, after the \
  77. definition of |SMALL_MEMORY|. */
  78.  
  79. /* Name of \FWEB's default style file. \
  80. \It{Please don't change this unless you absolutely have to! \
  81. Use the \.{-z} option instead.} */
  82.  
  83. #define STYLE_FILE_NAME "fweb.sty"
  84.  
  85. /* Here are the default file extensions for each language. */
  86.  
  87. #define C_EXT "c"
  88. #define V_EXT "mk"
  89. #define X_EXT "sty"
  90.  
  91. /* Unix. */
  92. #define Cpp_EXT "c++"
  93. #define R_EXT "r"
  94. #define R90_EXT "r90"
  95. #define N_EXT "f"
  96. #define N90_EXT "f90"
  97.  
  98. #define HAVE_TMPNAM 1
  99. #define HAVE_TEMPNAM 0
  100.  
  101.  
  102. /* The |FANCY_SPLIT| flag is used for buffering the output lines of C~code. \
  103. Define this if the C~compiler CAN'T continue an incomplete line with a \
  104. backslash.  (ANSI compilers should be able to.) \
  105. {\bf (This code may not be fully debugged yet!)} */
  106.  
  107. #define FANCY_SPLIT 0
  108.  
  109.  
  110. /* --- INCLUDING FILES --- */
  111.  
  112. /* The code is written in C, and various header files of the form \
  113. ``\.{<*.h>}'' are included near the beginning of each source file.  The \
  114. names of these files are standardized by ANSI.  Unfortunately, not everyone \
  115. has gotten around to ANSI yet.  Therefore, here we include important files \
  116. whose names may be nonstandard or whose functions may fluctuate. */
  117.  
  118. /* Does the ANSI \.{stdlib.h} exist?  If so, say so here.  This is \
  119. supposed to contain prototypes for the following functions used by \FWEB: \
  120. |abort|, |abs|, |atof|, |atoi|, |atol|, |calloc|, |exit|, |free|, |getenv|, \
  121. |realloc|, |strtod|, |strtol|.  If it doesn't, either find the prototypes \
  122. in another file and include it here, or actually give the prototypes here. \
  123. */
  124.  
  125. #define HAVE_STDLIB_H 1
  126.  
  127. #define HAVE_STDARG_H 1
  128.  
  129.  
  130. /* Does the ANSI \.{stddef.h} exist?  If so, include it here.  This is \
  131. supposed to define the |NULL| pointer, and the type |size_t|.  Sometimes \
  132. these are defined in other places as well. */
  133.  
  134. #define HAVE_STDDEF_H 0
  135.  
  136. /* Other stuff handled by auto-config. */
  137. #define HAVE_STRING_H 1
  138.  
  139. #define HAVE_MEMORY_H 0
  140.  
  141. #define HAVE_FLOAT_H 1
  142.  
  143. /* Does  (non-ANSI) \.{sys/types.h} exist?  You may find some useful stuff \
  144. in here. But don't use it unless you have to. */
  145.  
  146. #include<sys/types.h>
  147.  
  148. /* Must we include an extra file for memory management?  E.g., for \
  149. Microsoft, \.{malloc.h}; for Borland; \.{alloc.h}.  Not necessary for ANSI; \
  150. it's in \.{stdlib.h}. */
  151.  
  152. /*  #include<malloc.h> */
  153.  
  154. /* Numerical limits.  We use the following ANSI macros: |INT_MAX|, \
  155. |INT_MIN|, |LONG_MAX|, |LONG_MIN|, and |ULONG_MAX| which are found in \
  156. \.{limits.h}. If you can't find those macros, define the flag \
  157. |NON_ANSI_LIMITS|, and possibly include another file with different names \
  158. for the limits, such as \.{values.h} on the Sun.  The flag \
  159. |NON_ANSI_LIMITS| assumes that the macros |MAXINT| and |MAXLONG| are \
  160. defined.  If they are not, you must define them here. */
  161.  
  162. #define HAVE_LIMITS_H 1
  163. #define HAVE_VALUES_H 0
  164.  
  165. /* Please note that additional files are included automatically \
  166. (essentially immediately after this file is read; see \.{includes.hweb}). \
  167. These were considered to be standard, but that might be a mistake.  Those \
  168. files are: \
  169. \.{string.h}, \.{stdio.h}, \.{ctype.h}, \.{setjmp.h}, \.{time.h}.  Remember \
  170. that by convention these files should limit themselves to being included \
  171. only once.  Therefore, if for some reason you need to include one of these \
  172. somewhere in this file, you should be able to do it without difficulty; the \
  173. later automatic include just won't be done if those files are following \
  174. standard protocol. */
  175.  
  176. #define ANSI_CTYPE_H 1
  177.  
  178.  
  179. /* --- VARIABLE-LENGTH ARGUMENT LISTS --- */
  180.  
  181. /* For convenience, FWEB attempts to use functions with variable numbers of \
  182. arguments.  We attempt to support two conventions: ANSI, and Sun's.  If \
  183. this feature is supported, define the flag |VARIABLE_ARGUMENTS|, say \
  184. whether |va_start| has one or two arguments, and include \
  185. the associated header file (\.{stdarg.h} for ANSI). */
  186.  
  187. /* Does the compiler allow ANSI-style variable arguments? */
  188.  
  189. #define VARIABLE_ARGUMENTS 1
  190.  
  191. /* Is |va_start| defined with one argument (Sun's convention) or two \
  192. (ANSI)? */
  193. #define NUM_VA_ARGS 2
  194. #define HAVE_STDARG_H 1
  195.  
  196.  
  197. /* --- ADDITIONAL PROTOTYPES --- */
  198.  
  199. /* You may wish to collect any additional prototypes that are required and \
  200. put them into your own header file that you include here. */
  201.  
  202. /* If the flag |HAVE_STD_PROTOTYPES| is false, it causes the file \
  203. \.{stdlib0.h} to be loaded.  This contains ANSI prototypes that for some \
  204. reason aren't provided with the \.{gcc}~environment on the Sun. */
  205. #define HAVE_STD_PROTOTYPES 0
  206.  
  207. /* Define the flag |OLD_PROTOTYPES| for \
  208. compilers that don't support the new (ANSI) style of function declaration \
  209. and prototyping.  The new style is |fcn(int i,char *s){}|; the old style is \
  210. |fcn(i,s) int i; char *s; {}|. */
  211.  
  212. #define OLD_PROTOTYPES 0
  213.  
  214. /* ANSI also introduces the type |void|.  If your compiler doesn't \
  215. understand the constructions |void *| and |void fcn()|, define |NO_VOID|. */
  216.  
  217. #define NO_VOID 0
  218.  
  219.  
  220. /* --- SPECIAL TYPES --- */
  221.  
  222. /* ANSI defines the |size_t| type, which is the type of something returned \
  223. from the |sizeof| operator.  If this type is defined, define \
  224. |SIZE_T_DEFINED|. */
  225.  
  226. #define SIZE_T_DEFINED 1
  227.  
  228.  
  229. /* |const| seems to be an annoyance; not all compilers treat it the same \
  230. way.  We really only want it for debugging, anyway, so we mostly just \
  231. remove it.  It's kept when compiling on the Sun with \.{gcc}, because it \
  232. gives the developer more checks on the code.  If you want to keep it, \
  233. define |KEEP_CONST|. */
  234.  
  235. #define KEEP_CONST 1
  236.  
  237. /* For personal computers, the kind of pointer is an issue.  They must be \
  238. |huge|.  If your compiler understands |huge|, define |HUGE_POINTERS|. */
  239.  
  240. #define HUGE_POINTERS 0
  241.  
  242.  
  243. /* --- SPECIAL FUNCTIONS --- */
  244.  
  245. /* The ANSI |sprintf| function returns the number of characters written. \
  246. If this is the case on your system, define |ANSI_SPRINTF|.  (It's always \
  247. safe to not define it. */
  248.  
  249. #define ANSI_SPRINTF 0
  250.  
  251. /* The ANSI |sscanf| does some cute things. */
  252. #define ANSI_SSCANF 1
  253.  
  254. /* The ANSI |system| function is supposed to take |NULL| as an argument, \
  255. which means check if a command processor exists.  If this works properly, \
  256. defined |ANSI_SYSTEM|.  (It doesn't work on the Sun.) */
  257.  
  258. #define ANSI_SYSTEM 0
  259.  
  260.  
  261. /* --- ANNOYING WARNINGS --- */
  262.  
  263. /* Sometimes the compiler can't understand that the \
  264. control flow can never get to the bottom of a function. To avoid warning \
  265. complaints, we have the following: */
  266. #define DUMMY_RETURN(value) return value
  267.  
  268.  
  269. /* --- UNUSUAL NAMES --- */
  270.  
  271. /* Put here any definitions that override standard names.  For example, on \
  272. the MAC one has to say ``\.{\#define getc agetc}''. */
  273. /* Nothing to be done. */
  274.  
  275.  
  276. /* --- DIRECTORY SPECIFICATIONS --- */
  277.  
  278. /* Directory specifications are delimited in different ways under the various \
  279. operating systems. Unix: \.{'/'}; IBM-PC: \.{'\\'}; VAX/VMS: \,{']'}. */
  280. #define PREFIX_END_CHAR '/' /* The Unix convention. */
  281.  
  282.  
  283. /* --- TIMING --- */
  284.  
  285. /* First of all, we have a flag to say whether timing information is \
  286. printed at the end of the run.  (If you can't figure out the timing \
  287. routines for your machine or don't want a timing information line at the \
  288. end of your terminal output, don't define this.) */
  289.  
  290. #define TIMING 1
  291.  
  292. /* --- Number of decimal places  for timing information in seconds.  (Use \
  293. at least 2 for supercomputers.) --- */
  294. #define timing_width 1
  295.  
  296. /* There's supposed to be a function |clock()| that returns the cpu time, \
  297. in units of |CLOCKS_PER_SEC|.  The type of |clock| is |clock_t|.  If that \
  298. is defined, define the flag |CLOCK_T_DEFINED|; otherwise, say |typedef ... \
  299. clock_t| here. */
  300.  
  301. #define CLOCK_T_DEFINED 1
  302.  
  303. /* Some systems don't define |CLOCKS_PER_SEC|.  If not, we try |CLK_TCK|. \
  304. If that's not defined, it defaults to 1000000.  If that's not appropriate, \
  305. define |CLOCKS_PER_SEC| here. */
  306.  
  307. /* \
  308. #define CLOCKS_PER_SEC 1000000 \
  309. */
  310.  
  311. /* Are there system routines that return wall-clock time in sub-second units? \
  312. First, look for |gettimeofday| ($\mu$sec timing). */
  313. #define HAVE_GETTIMEOFDAY 1
  314.  
  315. /* Otherwise, does the file sys/timeb.h exist that along with |ftime| gives \
  316. millisecond timing for wall-clock time?  We check for the header file, not \
  317. |ftime| itself, since |ftime| may be in a Berkeley compatibility library, \
  318. not in \.{libc}. */
  319.  
  320. #define HAVE_SYS_TIMEB_H 0
  321.  
  322. /* Do we use our own version of difftime(), which computes the difference \
  323. of two wall clock times?  If so, define |NEW_DIFFTIME|.  This flag should \
  324. always be defined if |HAVE_SYS_TIMEB_H| is defined above.  */
  325.  
  326. #define NEW_DIFFTIME 1
  327.  
  328.  
  329. /* --- MAKING IT FIT --- */
  330.  
  331. /* Sometimes the compiler can't handle functions or switches that are too \
  332. large.  In that case, define |FCN_CALLS|.  That converts certain in-line \
  333. code (such as in the syntax production analyzer) into function calls (at \
  334. the price of slowing things down a bit). */
  335.  
  336. #define FCN_CALLS 0
  337.  
  338. /* The personal computers are starved for memory.  For those machines, we \
  339. specify smaller default values for the lengths of dynamic arrays; define \
  340. |SMALL_MEMORY|.  (You can always use the \.{-y} option to override these \
  341. defaults.) */
  342.  
  343. #define SMALL_MEMORY 0
  344.  
  345. /* Name of \FWEB's default initialization file.  Please don't change these \
  346. conventions unless you absolutely have to!!!  Also, note that these \
  347. definitions are overridden by the environment variable |FWEB_INI|, if it is \
  348. defined. */
  349.  
  350. #ifndef SMALL_MEMORY
  351. #define SMALL_MEMORY 0
  352. #endif
  353.  
  354. #if SMALL_MEMORY
  355. #define FWEB_INI "fweb.ini"
  356. #else
  357. #define FWEB_INI ".fweb"
  358. #endif
  359.  
  360.  
  361. /* --- MEMORY ALLOCATIONS --- */
  362.  
  363. /* The ANSI |calloc| routine takes two arguments:  |void \
  364. *calloc(size_t,size_t)|. If the system doesn't have a standard |calloc| \
  365. routine, or if the name isn't standard, you must define an UPPERCASE macro \
  366. that does the same thing.  (The name isn't standard on personal computers \
  367. because one is dealing with |huge| allocations.)  If you define \
  368. |NON_ANSI_CALLOC|, you must define |CALLOC|, |REALLOC|, and |FREE|.  E.g., the \
  369. relevant definitions for Borland are \
  370. \begintt \
  371. #define CALLOC farcalloc \
  372. #define REALLOC(oldblock,nbytes) \ \
  373.  farrealloc((void far *)(oldblock),(unsigned long)(nbytes)) \
  374. #define FREE(block) farfree((void far *)(block)) \
  375. \endtt \
  376. */
  377.  
  378. #define NON_ANSI_CALLOC 0
  379.  
  380. /* |IBMPC| */
  381.  
  382. /* Do we supply below a routine that obtains the available memory, such \
  383. as Borland's farcoreleft()? */
  384.  
  385. #define PRINT_AVAILABLE_MEMORY 0
  386.  
  387. /* The function call that obtains the memory is called |CORE_LEFT|.  This \
  388. function is assumed to return an |unsigned long int|.  For Microsoft, we had \
  389. to write our own routine |_hmemavl|; see below.  For Borland, the routine \
  390. should be called |farcoreleft|.  For the other machines, we don't have \
  391. anything as yet. */
  392.  
  393.  
  394.  
  395.  
  396. /* The following flag is defined only by \.{common.web}. */
  397. #ifdef COMMON_FCNS_
  398.  
  399. /* Give here the C code for any additional functions that are \
  400. compiler-specific or missing from your implementation, such as maybe \
  401. |strtod|.  Note that these are bracketed with the flag COMMON_FCNS_ so they \
  402. are compiled into just one module, namely \.{common.c}. You must \
  403. always supply some version of the debugging routine |trap|, which must \
  404. return~0 as a minimum. */
  405.  
  406.  
  407. /* The default |trap| function for debugging. */
  408. int trap()
  409. {return 0;}
  410.  
  411. #endif /* |COMMON_FCNS_| */
  412.  
  413.  
  414.